import { Spin } from "@arco-design/web-react";
import React, { useState } from "react";
import { PgyerUrl } from "../../main/constants/GlobalConfig";

export function upApkInfoView(uploadResult?: any) {
  const [pgyerUrl, setPgyerUrl] = useState(PgyerUrl);
  return (
    <div style={{ marginTop: 20, whiteSpace: "pre-line" }}>
      上传结果：
      <Spin />
      {uploadResult && (
        <div>
          App Name: {uploadResult.buildName}
          <br />
          Version: {uploadResult.buildVersion}
          <br />
          APK: {uploadResult.buildFileName}
          <br />
          Build Version: {uploadResult.buildBuildVersion}
          <br />
          更新时间: {uploadResult.buildUpdated}
          <br />
          更新内容: {uploadResult.buildUpdateDescription}
          <br />
          文件大小: {uploadResult.buildFileSize}
          <br />
          <br />
          蒲公英地址:
          <a
            href={pgyerUrl}
            target="_blank"
            rel="noopener noreferrer"
          >
            {pgyerUrl}
          </a>
        </div>
      )}
    </div>
  );
}
